<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <script>
        var cartGoods = [
    {
        goodsname:'小米10',
        price:5000,
        isChecked:true // 代表是否选中了
    },
    {
        goodsname:'苹果10',
        price:3000,
        isChecked:false // 代表是否选中了
    }
]
// cartGoods.forEach(function(){
//     console.log(cartGoods);
// })
  var n = cartGoods.every(function(item){
      return  item.isChecked ;
  })
  console.log(n);


  var persons = [
    {
        username:'张飞',
        sex:'男',
        salary:50000
    },
    {
        username:'关羽',
        sex:'男',
        salary:60000
    }
]
var a = persons.map(function(item){
    return  {
        username:item.username,
        sex:item.sex,
        salary:item.salary + 2000,
    };
})
console.log(a);
   </script>
</body>
</html>